<html>
   <head>
      <link rel="stylesheet" type="text/css" href="style.css" />
   </head>
   <body onload="">
<h2 class="comptitle">Simple Module <i>SimpleBattery</i></h2>
<b>Package:</b> org.mixim.modules.power.battery<br/><b>File: <a href="modules-power-battery-SimpleBattery.ned.html">modules/power/battery/SimpleBattery.ned</a></b><br/><p><a href="../doxy/a00174.html" target="mainframe"><b>C++ definition</b></a></p>

<p>a simple battery module</p>
<p>Note that resolution should be much smaller than the expected time to
first node failure.</p>
<img src="org.mixim.modules.power.battery.SimpleBattery-type.png" ismap="yes" usemap="#type-diagram"/><map name="type-diagram">
<area shape="rect" href="org.mixim.modules.power.battery.SimpleBattery.html" title="SimpleBattery" alt="SimpleBattery" coords="0,0,137,40">
</map>
<h3 class="subtitle">Usage diagram:</h3>
<p>The following diagram shows usage relationships between types.
Unresolved types are missing from the diagram. Click <a href="full-ned-usage-diagram.html">here</a> to see the full picture.</p>
<img src="org.mixim.modules.power.battery.SimpleBattery-usage.png" ismap="yes" usemap="#usage-diagram"/><map name="usage-diagram"><area shape="rect" id="node1" href="org.mixim.modules.power.battery.SimpleBattery.html" title="Simple Module SimpleBattery" alt="" coords="301,83,405,111">
<area shape="rect" id="node2" href="org.mixim.modules.node.Host802154_2400MHz.html" title="Compound Module Host802154_2400MHz" alt="" coords="5,6,160,34">
<area shape="rect" id="node4" href="org.mixim.modules.node.Host802154A.html" title="Compound Module Host802154A" alt="" coords="184,6,285,34">
<area shape="rect" id="node6" href="org.mixim.modules.node.HostBMAC.html" title="Compound Module HostBMAC" alt="" coords="309,6,397,34">
<area shape="rect" id="node8" href="org.mixim.modules.node.HostLMAC.html" title="Compound Module HostLMAC" alt="" coords="421,6,507,34">
<area shape="rect" id="node10" href="org.mixim.examples.ieee802154Narrow.PhyMacHost.html" title="Compound Module PhyMacHost" alt="" coords="531,6,629,34">
</map>
<h3 class="subtitle">Inheritance diagram:</h3>
<p>The following diagram shows inheritance relationships for this type.
Unresolved types are missing from the diagram. Click <a href="full-ned-inheritance-diagram.html">here</a> to see the full picture.</p>
<img src="org.mixim.modules.power.battery.SimpleBattery-inheritance.png" ismap="yes" usemap="#inheritance-diagram"/><map name="inheritance-diagram"><area shape="rect" id="node1" href="org.mixim.modules.power.battery.SimpleBattery.html" title="Simple Module SimpleBattery" alt="" coords="5,83,109,111">
<area shape="rect" id="node2" href="org.mixim.base.modules.BaseBattery.html" title="Simple Module BaseBattery" alt="" coords="11,6,104,34">
</map>
<h3 class="subtitle">Extends:</h3>
<table>
<tr>
   <td>
      <a href="org.mixim.base.modules.BaseBattery.html">BaseBattery</a>
      <i> (simple&nbsp;module)</i>
   </td>
   <td>
<i>(no description)</i>
   </td>
</tr>
</table>
<h3 class="subtitle">Used in compound modules:</h3>
<p>If a module type shows up more than once, that means it has been defined in more than one NED file.</p>
<table>
<tr>
   <td>
      <a href="org.mixim.modules.node.Host802154_2400MHz.html">Host802154_2400MHz</a>
      <i> (compound&nbsp;module)</i>
   </td>
   <td>

<p>This NED module defines a host using an IEEE 802.15.4 transceiver at 2.4GHz
for wireless communications, that can be used to simulate wireless sensor
networks. </p>
   </td>
</tr>
<tr>
   <td>
      <a href="org.mixim.modules.node.Host802154A.html">Host802154A</a>
      <i> (compound&nbsp;module)</i>
   </td>
   <td>

<p>This host NED module models a host using an IEEE 802.15.4A correlation receiver.</p>
   </td>
</tr>
<tr>
   <td>
      <a href="org.mixim.modules.node.HostBMAC.html">HostBMAC</a>
      <i> (compound&nbsp;module)</i>
   </td>
   <td>

<p>Example host module using a <a href="org.mixim.examples.bmac.BMAC.html">BMAC</a> Network interface card.</p>
   </td>
</tr>
<tr>
   <td>
      <a href="org.mixim.modules.node.HostLMAC.html">HostLMAC</a>
      <i> (compound&nbsp;module)</i>
   </td>
   <td>

<p>Example host module using a <a href="org.mixim.examples.lmac.LMAC.html">LMAC</a> Network interface card.</p>
   </td>
</tr>
<tr>
   <td>
      <a href="org.mixim.examples.ieee802154Narrow.PhyMacHost.html">PhyMacHost</a>
      <i> (compound&nbsp;module)</i>
   </td>
   <td>
<i>(no description)</i>
   </td>
</tr>
</table>
<h3 class="subtitle">Parameters:</h3>
<table class="paramtable">
   <tr>
      <th>Name</th>
      <th>Type</th>
      <th>Default value</th>
      <th>Description</th>
   </tr>
<tr class="local">
   <td width="150">debug</td>
   <td width="100">
      <i>bool</i>
   </td>
   <td width="120"></td>
   <td>   </td>
</tr>
<tr class="local">
   <td width="150">nominal</td>
   <td width="100">
      <i>double</i>
   </td>
   <td width="120"></td>
   <td>
<p>nominal battery capacity</p>
   </td>
</tr>
<tr class="local">
   <td width="150">capacity</td>
   <td width="100">
      <i>double</i>
   </td>
   <td width="120"></td>
   <td>
<p>battery capacity</p>
   </td>
</tr>
<tr class="local">
   <td width="150">voltage</td>
   <td width="100">
      <i>double</i>
   </td>
   <td width="120"></td>
   <td>
<p>nominal voltage</p>
   </td>
</tr>
<tr class="local">
   <td width="150">resolution</td>
   <td width="100">
      <i>double</i>
   </td>
   <td width="120"></td>
   <td>
<p>capacity is updated at least every resolution time</p>
   </td>
</tr>
<tr class="local">
   <td width="150">publishDelta</td>
   <td width="100">
      <i>double</i>
   </td>
   <td width="120"></td>
   <td>
<p>if &gt; 0, capacity is published to the BB each publishTime 
interval</p>
   </td>
</tr>
<tr class="local">
   <td width="150">publishTime</td>
   <td width="100">
      <i>double</i>
   </td>
   <td width="120"></td>
   <td>
<p>number of modules that will draw energy from the 
battery</p>
   </td>
</tr>
<tr class="local">
   <td width="150">numDevices</td>
   <td width="100">
      <i>int</i>
   </td>
   <td width="120"></td>
   <td>
   </td>
</tr>
</table>
<h3 class="subtitle">Properties:</h3>
<table class="paramtable">
   <tr>
      <th>Name</th>
      <th>Value</th>
      <th>Description</th>
   </tr>
<tr>
   <td width="150">display</td>
   <td width="100"><i>i=block/control</i></td>
   <td></td>
</tr>
<tr>
   <td width="150">class</td>
   <td width="100"><i>SimpleBattery</i></td>
   <td></td>
</tr>
</table>
<h3 class="subtitle">Source code:</h3>
<pre class="src"><span style="color: #808080; font-style: italic; ">//
// a simple battery module
//
// Note that resolution should be much smaller than the expected time to
// first node failure.
//
</span><span style="color: #800000; font-weight: bold; ">simple</span><span style="color: #000000; "> </span><span style="color: #000000; ">SimpleBattery</span><span style="color: #000000; "> </span><span style="color: #800000; font-weight: bold; ">extends</span><span style="color: #000000; "> </span><span style="color: #000000; ">BaseBattery</span><span style="color: #000000; ">
{
    </span><span style="color: #800000; font-weight: bold; ">parameters</span><span style="color: #000000; ">:
        </span><span style="color: #000000; font-weight: bold; ">@class</span><span style="color: #000000; ">(</span><span style="color: #000000; ">SimpleBattery</span><span style="color: #000000; ">);
        </span><span style="color: #000080; font-weight: bold; ">bool</span><span style="color: #000000; "> </span><span style="color: #000000; ">debug</span><span style="color: #000000; ">;
        </span><span style="color: #808080; font-style: italic; ">// nominal battery capacity
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">volatile</span><span style="color: #000000; "> </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">nominal</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">mAh</span><span style="color: #000000; ">);
        </span><span style="color: #808080; font-style: italic; ">// battery capacity
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">capacity</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">mAh</span><span style="color: #000000; ">);
        </span><span style="color: #808080; font-style: italic; ">// nominal voltage 
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">volatile</span><span style="color: #000000; "> </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">voltage</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">V</span><span style="color: #000000; ">);
        </span><span style="color: #808080; font-style: italic; ">// capacity is updated at least every resolution time
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">volatile</span><span style="color: #000000; "> </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">resolution</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">s</span><span style="color: #000000; ">);

        </span><span style="color: #808080; font-style: italic; ">// (0..1): capacity is published to the blackboard each time it is
</span><span style="color: #000000; ">		</span><span style="color: #808080; font-style: italic; ">// observed to have changed by publishDelta * nominal_capacity
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">volatile</span><span style="color: #000000; "> </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">publishDelta</span><span style="color: #000000; ">;

        </span><span style="color: #808080; font-style: italic; ">// if &gt; 0, capacity is published to the BB each publishTime 
</span><span style="color: #000000; ">		</span><span style="color: #808080; font-style: italic; ">// interval		
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">volatile</span><span style="color: #000000; "> </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">publishTime</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">s</span><span style="color: #000000; ">);

        </span><span style="color: #808080; font-style: italic; ">// number of modules that will draw energy from the 
</span><span style="color: #000000; ">		</span><span style="color: #808080; font-style: italic; ">// battery
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">int</span><span style="color: #000000; "> </span><span style="color: #000000; ">numDevices</span><span style="color: #000000; ">;

}
</span></pre>
   <hr><p class="footer"><a href="http://creativecommons.org/licenses/by-sa/3.0" target="_top"><img src="by-sa.png"></a> This documentation is released under the <a href="http://creativecommons.org/licenses/by-sa/3.0" target="_top">Creative Commons license</a></p>
   </body>
</html>
